package com.zfzs.post.modules.agent.repository;

import com.zfzs.post.modules.agent.domain.WithdrawOrder;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

/**
 * 提现
 *
 * @author ck
 * @date 2019-10-18
 */
public interface WithdrawOrderRepository extends JpaRepository<WithdrawOrder, Integer>, JpaSpecificationExecutor {

    //提现列表
    @Query(value = "select w.create_date as createDate,w.all_amount as amount from withdraw_order w where w.agent_id = ?1 and w.status = 1", nativeQuery = true)
    List<Map<Map,Object>> withdrawList(Long agentId);
}